#ifndef GMKeyChangeSDL_h__
#define GMKeyChangeSDL_h__

#include "GameMessage.h"
#include "Client.h"

class GMKeyChangeSDL: public GameMessage
{
public:
    GMKeyChangeSDL() : m_type(0), m_state(0), m_key(-1), m_clientID(-1) {}
    virtual void WriteToSckMsg( Networking::SockMsg* sm );
    virtual bool Execute();
    virtual bool ReadFromSckMsg(Networking::SockMsg* sm );
    virtual const char* GetTypeName() const;
    void SetKey(const SDL_KeyboardEvent& e);
    void SetClientID(int id){m_clientID = id;}

public:
    static const char* NAME;
    int m_type;	/* SDL_KEYDOWN or SDL_KEYUP */
    int m_state;	/* SDL_PRESSED or SDL_RELEASED */
    int m_key;
    int m_clientID;
};

#endif // GMKeyChange_h__